/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.mer.entity;

import org.hibernate.validator.constraints.Length;
import com.kaaction.modules.sys.entity.User;

import com.kaaction.common.persistence.DataEntity;

/**
 * 商品种类Entity
 * @author huanghaiming
 * @version 2017-05-21
 */
public class Sku extends DataEntity<Sku> {
	
	private static final long serialVersionUID = 1L;
	private String code;		// sku编号
	private String name;		// sku名称
	private Integer num;		// 数量
	private Spu spu;		// spu的编号
	private double price;		// 价格
	private User user;		// user_id
	private String type;		// 普通商品，还是活动商品
	private String eventchannelId;		// eventchannel_id
	private String status;		// status
	private Color color;		// 颜色
	private Size size;		// 尺寸
	
	private String colorId;		// 颜色
	private String sizeId;		// 尺寸
	private String spuId;		// spu的编号
	
	public Sku() {
		super();
	}

	public Sku(String id){
		super(id);
	}

	@Length(min=0, max=255, message="sku编号长度必须介于 0 和 255 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=255, message="sku名称长度必须介于 0 和 255 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=11, message="数量长度必须介于 0 和 11 之间")
	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public Spu getSpu() {
		return spu;
	}

	public void setSpu(Spu spu) {
		this.spu = spu;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=0, max=3, message="普通商品，还是活动商品长度必须介于 0 和 3 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@Length(min=0, max=64, message="eventchannel_id长度必须介于 0 和 64 之间")
	public String getEventchannelId() {
		return eventchannelId;
	}

	public void setEventchannelId(String eventchannelId) {
		this.eventchannelId = eventchannelId;
	}
	
	@Length(min=0, max=3, message="status长度必须介于 0 和 3 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public Size getSize() {
		return size;
	}

	public void setSize(Size size) {
		this.size = size;
	}

	public String getSpuId() {
		return spuId;
	}

	public void setSpuId(String spuId) {
		this.spuId = spuId;
	}

	public String getColorId() {
		return colorId;
	}

	public String getSizeId() {
		return sizeId;
	}

	public void setSizeId(String sizeId) {
		this.sizeId = sizeId;
	}

	public void setColorId(String colorId) {
		this.colorId = colorId;
	}
	
	
	
}